<template>
  <div class="result">
    <div class="result__show">

    </div>
    <div class="result__code">
      <pre style="white-space: pre-line;">
        <code v-html="codeFormat"></code>
      </pre>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ThemeResult',
  props: {
    code: {
      type: Object,
      default: () => ({})
    }
  },
  computed: {
    codeFormat() {
      let str = '';

      Object.entries(this.code).forEach(([key, val]) => {
        str += `${key}: ${val}; \n`
      })

      return str;
    }
  }
}
</script>

<style lang="scss" scoped>
.result {
  display: flex;
  align-items: center;

  &__code,
  &__show {
    flex: 1;
  }

  &__code {

  }
}
</style>
